{%extend name="Public:layout"/%}

{%block name="title"%}
<h2 class="mb20">
	推送测试
</h2>
{%/block%}

{%block name="contents"%}
<form action="{%:U('/admin/push/index')%}" onsubmit="return false;" stverify="true" erroappend="true" method="post"
      beforeSubFun="" enctype="multipart/form-data">
    <table class="table table-listing table-hovered">
        <tr>
          <td>
          	  <lable>通知栏提示文字<input class="input" type="text" name="ticker" value="" /></lable>
              
              <lable>通知标题<input class="input" type="text" name="title" value="" /></lable>
              
              <lable>通知文字描述<input class="input" type="text" name="text" value="" /></lable>
              
          </td>
        </tr>
        <tr>
          <td>
          	 发送类型<br /> 
				<label><input name="notification" type="radio" value="1" />单播 </label> 
				<label><input name="notification" type="radio" value="2" checked/>广播 </label> 
				<label><input name="notification" type="radio" value="3" />组播 </label> 
				<label><input name="notification" type="radio" value="4" />文件播 </label> 
				<label><input name="notification" type="radio" value="5" />自定义播</label> 
          </td>
        </tr>
        <tr>
            <td>
                <input class="btn btn-blue" type="submit" value="提交">
            </td>
        </tr>
    </table>
</form>
{%/block%}

{%block name="js"%}
<script type="text/javascript">
	$(function(){
		
		$("input[type='submit']").click(function(event){
			event.preventDefault();
			if($("input[name='notification']:checked").length == 0){
				return false;
			}
			var url = $("form").attr("action");
			$.post(url, $("form").serialize(), function(data){
				alert(data.info);
			},"json");
			
			return false;
		});
		
	});
</script>
{%/block%}
